/* CME Auto Group - Professional Dealership Design */

:root {
    --primary-color: #1a365d;
    --primary-light: #2c5282;
    --secondary-color: #d63031;
    --accent-color: #74b9ff;
    --text-dark: #2d3748;
    --text-light: #4a5568;
    --text-muted: #718096;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --bg-subtle: #f1f5f9;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --error-color: #e17055;
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Source Serif Pro', Georgia, serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 0.125rem;
    --radius-md: 0.25rem;
    --radius-lg: 0.375rem;
    --radius-xl: 0.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--bg-subtle);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }

/* Top Ribbon */
.top-ribbon {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    position: sticky;
    top: 0;
    z-index: 101;
}

.ribbon-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ribbon-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.ribbon-cta {
    font-weight: 500;
}

.ribbon-phone {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.ribbon-phone:hover {
    color: white;
}

.ribbon-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.business-hours {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.hours-display {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.9;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.open {
    background: var(--success-color);
    box-shadow: 0 0 6px rgba(0, 184, 148, 0.6);
}

.status-indicator.closed {
    background: var(--error-color);
    box-shadow: 0 0 6px rgba(225, 112, 85, 0.6);
}

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 44px;
    z-index: 100;
}

.header-top {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.header-top a {
    color: white;
    text-decoration: none;
}

.header-top a:hover {
    color: var(--accent-color);
}

.header-main {
    padding: 0.75rem 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.025em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    letter-spacing: 0.025em;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(
        135deg,
        rgba(26, 54, 93, 0.95) 0%,
        rgba(44, 82, 130, 0.85) 100%
    ), url('../images/hero.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 5rem 0;
    min-height: 60vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.25rem;
    color: white;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.hero p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #b71c1c;
    border-color: #b71c1c;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* Cards */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.2s ease;
}

.card:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-white);
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

/* Vehicle Cards */
.vehicle-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.vehicle-card:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.vehicle-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.vehicle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vehicle-card:hover .vehicle-image img {
    transform: scale(1.02);
}

.vehicle-price {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--secondary-color);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}

.vehicle-status {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
}

.vehicle-status.status-pending {
    background: var(--warning-color);
}

.vehicle-status.status-sold {
    background: var(--error-color);
}

.vehicle-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vehicle-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.vehicle-details {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.vehicle-details span {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-light);
}

.vehicle-details span:last-child {
    border-bottom: none;
}

.vehicle-features {
    margin-top: 1rem;
    flex: 1;
}

.vehicle-features ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.vehicle-features li::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Vehicle Card Button Alignment */
.vehicle-card .vehicle-info {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vehicle-card .action-buttons,
.vehicle-card .mt-3 {
    margin-top: auto;
    padding-top: 0.75rem;
}

.vehicle-card .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.vehicle-card .btn:last-child {
    margin-right: 0;
}

/* Fix mt-3 spacing issue in compact dashboard */
.compact-dashboard .vehicle-card .mt-3 {
    margin-top: 0.75rem !important;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.625rem;
}

.col {
    flex: 1;
    padding: 0 0.625rem;
    margin-bottom: 1.25rem;
}

.col-1 { flex: 0 0 8.33%; max-width: 8.33%; padding: 0 0.625rem; margin-bottom: 1.25rem; }
.col-2 { flex: 0 0 16.67%; max-width: 16.67%; padding: 0 0.625rem; margin-bottom: 1.25rem; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 0.625rem; margin-bottom: 1.25rem; }
.col-4 { flex: 0 0 33.33%; max-width: 33.33%; padding: 0 0.625rem; margin-bottom: 1.25rem; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 0.625rem; margin-bottom: 1.25rem; }
.col-8 { flex: 0 0 66.67%; max-width: 66.67%; padding: 0 0.625rem; margin-bottom: 1.25rem; }
.col-9 { flex: 0 0 75%; max-width: 75%; padding: 0 0.625rem; margin-bottom: 1.25rem; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 0.625rem; margin-bottom: 1.25rem; }

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-dark);
    letter-spacing: 0.025em;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--bg-white);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.1);
    background: var(--bg-white);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    padding-right: 3rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    line-height: 1.5;
}

/* Search Filters */
.search-section {
    background: var(--bg-white);
    padding: 3rem 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.search-form {
    background: var(--bg-white);
    padding: 2rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 2.5rem 0 1rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section li {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-section ul {
    list-style: none;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-ribbon {
        padding: 0.375rem 0;
        font-size: 0.8rem;
    }
    
    .ribbon-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .ribbon-left {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header {
        top: 60px; /* Adjust for taller mobile ribbon */
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        display: none;
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .hero {
        padding: 4rem 0;
        min-height: 50vh;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .col-sm-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .vehicle-details span {
        font-size: 0.8rem;
        padding: 0.375rem 0;
    }
    
    .vehicle-features ul {
        grid-template-columns: 1fr;
    }
    
    /* Ensure containers work on mobile */
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    /* Fix any flexbox issues on mobile */
    .row {
        margin: 0 -0.5rem;
    }
    
    .row > [class*="col-"] {
        padding: 0 0.5rem;
    }
    
    /* Mobile-first approach for vehicle cards */
    .vehicle-card {
        margin-bottom: 1rem;
    }
}

/* Professional Elements */
.page-section {
    padding: 3rem 0;
    position: relative;
}

.py-3 { padding: 2rem 0; }
.py-4 { padding: 2.5rem 0; }
.py-5 { padding: 3rem 0; }

/* Showcase Cards */
.showcase-card {
    height: 100%;
    transition: all 0.2s ease;
}

.showcase-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.showcase-image {
    height: 200px;
    overflow: hidden;
    background: var(--bg-subtle);
}

.showcase-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.showcase-card:hover .showcase-image img {
    transform: scale(1.05);
}

.showcase-card .card-body {
    padding: 1.5rem;
}

.showcase-card h4 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.showcase-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.page-section + .page-section {
    border-top: 1px solid var(--border-light);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.section-header p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--border-color) 20%,
        var(--border-color) 80%,
        transparent 100%
    );
    margin: 1.5rem 0;
}

/* Utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.25rem; }
.p-5 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Sidebar and Layout Spacing */
.sidebar-container {
    padding-right: 1rem;
}

.main-content-container {
    padding-left: 1rem;
}

.inventory-sidebar .card {
    position: sticky;
    top: 1rem;
}

.inventory-sidebar .form-group:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .sidebar-container,
    .main-content-container {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Hide inventory filter sidebar on mobile */
    .sidebar-container {
        display: none !important;
    }
    
    /* Make main content full width when sidebar is hidden */
    .main-content-container {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Compact Dashboard Styles */
.compact-dashboard {
    font-size: 0.9rem;
}

.compact-dashboard .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.compact-dashboard .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.compact-dashboard .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.compact-dashboard .card {
    margin-bottom: 1rem;
}

.compact-dashboard .card-body {
    padding: 1rem;
}

.compact-dashboard .form-group {
    margin-bottom: 1rem;
}

.compact-dashboard .form-control {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.compact-dashboard .form-select {
    padding-right: 2.5rem;
    background-size: 14px 14px;
}

.compact-dashboard h1 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.compact-dashboard h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.compact-dashboard h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.compact-dashboard h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.compact-dashboard .vehicle-card {
    font-size: 0.9rem;
}

.compact-dashboard .vehicle-info {
    padding: 1rem;
}

.compact-dashboard .admin-vehicle-info {
    padding: 1rem;
}

/* Stats cards more compact */
.compact-dashboard .stats-card .card-body {
    padding: 1rem 0.75rem;
}

.compact-dashboard .stats-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.compact-dashboard .stats-card p {
    font-size: 0.85rem;
    margin-bottom: 0;
}